package com.winit.rabbitmq;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class MessageSend {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @Value("${ucloud_master_exchange}")
    private String ucloud_master_exchange;

    @Value("${ucloud_node_exchange}")
    private String ucloud_node_exchange;

    private final String ROUTE_KEY=RabbitMqConsts.MASTER_ROUTE;

    public void sendTaskMessage(MqMessage msg){

        amqpTemplate.convertAndSend(ucloud_master_exchange,ROUTE_KEY, msg);
    }


}
